package com.yuju.group.enums;

/**
 * 类名：AgentCustomReturnCodeEnum  <br />
 *
 * 功能：
 *
 * @author : jiaokn <br />
 * @Date : 2017年11月24日 下午1:53:07  <br />
 * @version : 1.1 <br />
 */
public enum AgentCustomReturnCodeEnum {
	AGENTCUSTOM_SAVE_SUCCESS("yuju-agentCustom-1001", "中介信息新增成功"),
	AGENTCUSTOM_SAVE_FAILURE("yuju-agentCustom-1002", "中介信息新增失败"),
	AGENTCUSTOM_DEL_SUCCESS("yuju-agentCustom-1003", "中介信息删除成功"),
	AGENTCUSTOM_DEL_FAILURE("yuju-agentCustom-1004", "中介信息删除失败"),
	AGENTCUSTOM_UPDATE_SUCCESS("yuju-agentCustom-1005", "中介信息更新成功"),
	AGENTCUSTOM_UPDATE_FAILURE("yuju-agentCustom-1006", "中介信息更新失败"),
	AGENTCUSTOM_QUERY_SUCCESS("yuju-agentCustom-1007", "中介信息查找成功"),
	AGENTCUSTOM_QUERY_FAILURE("yuju-agentCustom-1008", "中介信息查找失败");
	
	private String code;
	private String desc;
	
	AgentCustomReturnCodeEnum(String code, String desc) {
		this.code = code;
		this.desc = desc;
	}
	
	public static String getDescByCode(String code) {
		for (GroupReturnCodeEnum enume : GroupReturnCodeEnum.values()) {
			if (enume.getCode().equals(code)) {
				return enume.getDesc();
			}
		}
		
		return "未知枚举类型";
	}

	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	public String getDesc() {
		return desc;
	}

	public void setDesc(String desc) {
		this.desc = desc;
	}
}
